﻿
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
    <link rel="Shortcut Icon" href="~/common/images/2.png" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="~/common/css/css.css" rel="stylesheet" type="text/css" />
    <link href="~/common/css/common.css" rel="stylesheet" tyle="text/css" />
    <script src="~/common/js/jquery.min.1.8.2.js"></script>
    <script src="~/common/js/jquery.SuperSlide.2.1.1.js"></script>
    <script src="~/common/js/common_js.js"></script>
    <script src="~/common/js/footer.js"></script>
    <script src="~/common/js/template-web.js"></script>
    @RenderSection("Head", false)
</head>
<body>
    <!--顶部样式-->
    <div id="top">
        <div class="top">
            <div class="hd_top_manu clearfix">
                <ul class="clearfix">
                    <li class="hd_menu_tit zhuce" data-addclass="hd_menu_hover">
                        欢迎光临本店！
                        <a href="~/Login/Index" id="isLogin" class="red">[请登录]</a>
                        新用户
                        <a href="~/Register/Index" class="red">[免费注册]</a>
                    </li>
                    <li class="hd_menu_tit" data-addclass="hd_menu_hover"><a href="~/User/UserOrder">我的订单</a></li>
                    <li class="hd_menu_tit" data-addclass="hd_menu_hover"> <a href="~/Cart/Index">购物车</a>(<b id="count">0</b>)</li>
                    <li class="hd_menu_tit" data-addclass="hd_menu_hover"><a href="http://wpa.qq.com/msgrd?v=3&uin=1028139084&site=qq&menu=yes">联系我们</a></li>
                    <li class="hd_menu_tit" data-addclass="hd_menu_hover" id="exitLogin"><a href="javascript:void();">退出登入</a></li>
                    @*<li class="hd_menu_tit list_name" data-addclass="hd_menu_hover">
                        <a href="http://wpa.qq.com/msgrd?v=3&uin=1028139084&site=qq&menu=yes" class="hd_menu">客户服务</a>
                        <div class="hd_menu_list">
                            <ul>
                                <li><a href="#">常见问题</a></li>
                                <li><a href="#">在线退换货</a></li>
                                <li><a href="#">在线投诉</a></li>
                                <li><a href="#">配送范围</a></li>
                            </ul>
                        </div>
                    </li>*@
                </ul>
            </div>
        </div>
    </div>
    <!--logo和搜索样式-->
    <div id="header" class="header">
        <div class="logo">
            @*<a href="#"><img src="~/images/logo.png" /></a>*@
           
            <a href="~/Home/Index"><img src="~/common/images/logo3.png" /></a>
            <div class="phone">
                免费咨询热线:<span class="telephone">400-3784-343</span>
            </div>
        </div>
        <div class="Search">
            <p><input name="" id="keyword" type="text" class="text" />
                <input name="" type="submit" value="" id="Search_btn" class="Search_btn" /></p>
            @*<p class="Words"><a href="#">苹果</a><a href="#">香蕉</a><a href="#">菠萝</a><a href="#">西红柿</a><a href="#">橙子</a><a href="#">苹果</a></p>*@
        </div>
    </div>
    <!--导航栏样式-->
    <div id="Menu" class="clearfix">
        <div class="Menu_style">
            <div id="allSortOuterbox" class="display">
                <div class="Category"><a href="#" class="Menu_img"><em></em></a></div>
                <div class="hd_allsort_out_box_new">
                    <!--左侧栏目开始-->
                    <div class="Menu_list">
                        <div class="menu_title">茶叶品种</div>
                        <a href="#">贡茗茶</a><a href="#">冠茗茶</a><a href="#">佳茗茶</a><a href="#">珍茗茶</a><a href="#">绿茶</a><a href="#">毛尖茶</a>
                    </div>
                    <div class="Menu_list">
                        <div class="menu_title">茶叶价格</div>
                        <a href="#">100以下</a><a href="#">100-200</a><a href="#">200-400</a><a href="#">400-600</a><a href="#">600-900</a><a href="#">1000以上</a>
                    </div>
                    <div class="Menu_list">
                        <div class="menu_title">推荐茶叶</div>
                        <ul class="recommend">
                            <li><a href="#" title="[2018年新茶]云雾茶...">[2018年新茶]云雾茶...</a></li>
                            <li><a href="#" title="[2018年新茶]铁观音...">[2018年新茶]铁观音...</a></li>
                            <li><a href="#" title="[2018年新茶]巴山雀舌毛尖茶新茶，含硒">[2018年新茶]巴山雀舌...</a></li>
                            <li><a href="#" title="[2018年新茶]巴山雀舌毛尖茶新茶，含硒">[2018年新茶]绿茶...</a></li>
                            <li><a href="#" title="[2018年新茶]巴山雀舌毛尖茶新茶，含硒">[2018年新茶]红茶...</a></li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="Navigation" id="Navigation">
                <ul class="Navigation_name">
                    <li><a class="nav_on" id="mynav1" href="~/Home/Index"><span>首页</span></a></li>
                    <li><a class="nav_on" id="mynav2" href="~/Home/List?categoryId=1"><span>巴山雀舌</span></a></li>
                    <li><a class="nav_on" id="mynav3" href="~/Home/List?categoryId=2"><span>贡茗</span></a></li>
                    <li><a class="nav_on" id="mynav4" href="~/Home/List?categoryId=3"><span>冠茗</span></a></li>
                    <li><a class="nav_on" id="mynav5" href="~/Home/List?categoryId=4"><span>臧芝堂（藏茶）</span></a></li>
                    <li><a class="nav_on" id="mynav6" href="~/Home/List?categoryId=6"><span>大巴山（茗茶）</span></a></li>
                    <li><a class="nav_on" id="mynav7" href="~/Home/List?categoryId=7"><span>达州（茶）</span></a></li>
                    @*<li><a class="nav_on" id="mynav8" href="#"><span>活动</span></a></li>*@
                    <li><a class="nav_on" id="mynav8" href="http://wpa.qq.com/msgrd?v=3&uin=1028139084&site=qq&menu=yes"><span>联系我们</span></a></li>
                </ul>
            </div>
            <!--购物车-->
            <div class="hd_Shopping_list" id="Shopping_list">
                <div class="s_cart"><em></em><a href="~/Cart/Index">我的购物车</a> <i class="ci-right">&gt;</i><i class="ci-count" id="shopping-amount">0</i></div>
                <div class="dorpdown-layer">
                    <div class="spacer"></div>
                    <!--<div class="prompt"></div><div class="nogoods"><b></b>购物车中还没有商品，赶紧选购吧！</div>-->
                    <ul class="p_s_list" id="cart">
                        <!--购物车-->
                        <li>
                            <div class="prompt"></div>
                            <div class="nogoods">
                                <b></b>购物车中还没有商品，赶紧选购吧！
                            </div>
                        </li>
                    </ul>
                    <div class="Shopping_style">
                        <div class="p-total">共<b id="goodTotalCount">0</b>件商品　共计<strong id="zongjia"></strong></div>
                        <a href="~/Cart/Index" title="去购物车结算" id="btn-payforgoods" class="Shopping">去购物车结算</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 背景阴影开始 -->
    <div style="width: 100%;height: 452px; background: rgba(237,237,237,0.2);position: relative;z-index: -1000;">
    </div>

    <div style="width: 100%; position: relative;top: -452px">
        @RenderBody()
        <!--底部样式-->
        <div class="footer">
            <div class="streak"></div>
            <div class="footerbox clearfix">
                <div class="left_footer">
                    <div class="img"><img src="~/common/images/logo3.png" width="221" /></div>
                    <div class="phone">
                        <h2>服务咨询电话</h2>
                        <p class="Numbers">400-3455-334</p>
                    </div>
                </div>
                <div class="right_footer">
                    <dl>
                        <dt><em class="icon_img"></em>购物指南</dt>
                        <dd><a href="#">怎样购物</a></dd>
                        <dd><a href="#">积分政策</a></dd>
                        <dd><a href="#">会员优惠</a></dd>
                        <dd><a href="#">订单状态</a></dd>
                        <dd><a href="#">产品信息</a></dd>
                        <dd><a href="#">怎样购物</a></dd>
                    </dl>
                    <dl>
                        <dt><em class="icon_img"></em>配送方式</dt>
                        <dd><a href="#">快递资费及送达时间</a></dd>
                        <dd><a href="#">快递覆盖地区查询</a></dd>
                        <dd><a href="#">验货与签收</a></dd>
                        <dd><a href="#">订单状态</a></dd>
                        <dd><a href="#">产品信息</a></dd>
                        <dd><a href="#">怎样购物</a></dd>
                    </dl>
                    <dl>
                        <dt><em class="icon_img"></em>配送方式</dt>
                        <dd><a href="#">货到付款</a></dd>
                        <dd><a href="#">支付宝</a></dd>
                        <dd><a href="#">财付通</a></dd>
                        <dd><a href="#">网银支付</a></dd>
                        <dd><a href="#">银联支付</a></dd>
                    </dl>
                    <dl>
                        <dt><em class="icon_img"></em>售后服务</dt>
                        <dd><a href="#">退换货原则</a></dd>
                        <dd><a href="#">退换货要求与运费规则</a></dd>
                        <dd><a href="#">退换货流程</a></dd>
                    </dl>
                    <dl>
                        <dt><em class="icon_img"></em>关于我们</dt>
                        <dd><a href="#">关于我们</a></dd>
                        <dd><a href="#">友情链接</a></dd>
                        <dd><a href="#">媒体报道</a></dd>
                        <dd><a href="#">新闻动态</a></dd>
                        <dd><a href="#">企业文化</a></dd>
                    </dl>
                </div>
            </div>
            <div class="slogen">
                <div class="footerbox clearfix ">
                    <ul class="wrap">
                        <li>
                            <a href="#"><img src="~/images/icon_img_02.png" data-bd-imgshare-binded="1"></a>
                            <b>正品保证</b>
                            <span>正品行货 放心选购</span>
                        </li>
                        <li>
                            <a href="#"><img src="~/images/icon_img_03.png" data-bd-imgshare-binded="2"></a>
                            <b>满68元包邮</b>
                            <span>购物满68元，免费快递</span>
                        </li>
                        <li>
                            <a href="#"><img src="~/images/icon_img_04.png" data-bd-imgshare-binded="3"></a>
                            <b>厂家直供</b>
                            <span>价格更低，质量更可靠</span>
                        </li>
                        <li>
                            <a href="#"><img src="~/images/icon_img_05.png" data-bd-imgshare-binded="4"></a>
                            <b>权威认证</b>
                            <span>政府扶持单位，安全保证</span>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="footerbox Copyright">
                <p><a href="#">关于我们</a> | <a href="#">隐私申明</a> | <script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://"); document.write(unescape("%3Cspan id='cnzz_stat_icon_1273799383'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s19.cnzz.com/z_stat.php%3Fid%3D1273799383%26show%3Dpic1' type='text/javascript'%3E%3C/script%3E"));</script> | <a href="#">茶叶</a> | <a href="#">博客</a> |<a href="#">友情链接</a> | <a href="#">网站地图</a></p>
                <p>Copyright 九江庐山云雾茶 amortal.cn All Rights Reserved </p>
                <p><a href="http://www.miitbeian.gov.cn/">赣ICP备17011934号-2</a></p>
                <a href="#" class="return_img"></a>
            </div>
        </div>
    </div>
    <!--右侧菜单栏购物车样式-->
    <div class="fixedBox">
        <ul class="fixedBoxList">
            <li class="fixeBoxLi user"><a href="~/User/Index"> <span class="fixeBoxSpan"></span> <strong>用户</strong></a> </li>
            <li class="fixeBoxLi Service ">
                <span class="fixeBoxSpan"></span> <strong>客服</strong>
                <div class="ServiceBox">
                    <div class="bjfffs"></div>
                    <dl onclick="javascript:;">
                        <dt><img src="http://q.qlogo.cn/headimg_dl?bs=qq&dst_uin=1028139084&src_uin=www.3464.com&fid=blog&spec=100" width="71" height="71"></dt>
                        <dd>
                            <strong>黎先生</strong>
                            <p class="p1">9:00-22:00</p>
                            <p class="p2">
                                <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=1028139084&site=qq&menu=yes">
                                点击交谈</a></p>
                        </dd>
                    </dl>
                    <dl onclick="javascript:;">
                        <dt><img src="http://q.qlogo.cn/headimg_dl?bs=qq&dst_uin=3243285414&src_uin=www.3464.com&fid=blog&spec=100" width="71" height="71"></dt>
                        <dd>
                            <strong>黎先生</strong>
                            <p class="p1">9:00-22:00</p>
                            <p class="p2"><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=3243285414&site=qq&menu=yes">点击交谈</a></p>
                        </dd>
                    </dl>
                </div>
            </li>
            <li class="fixeBoxLi code cart_bd " style="display:block;" id="cartboxs">
                <span class="fixeBoxSpan"></span> <strong>微信</strong>
                <div class="cartBox">
                    <div class="bjfff"></div>
                    <div class="QR_code">
                        <p><img src="~/common/images/weixinkefu.png" width="150px" height="150px" style=" margin-top:10px;" /></p>
                        <p>微信扫一扫，关注我们</p>
                    </div>
                </div>
            </li>
            @*<li class="fixeBoxLi Home"> <a href="./"> <span class="fixeBoxSpan"></span> <strong>收藏</strong> </a> </li>*@
            <li class="fixeBoxLi BackToTop"> <span class="fixeBoxSpan"></span> <strong>返回顶部</strong> </li>
        </ul>
    </div>

    <script id="test2" type="text/html">
        {{each cartRecordDTOs as value i}}
        <li>
            <div class="img"><img src='@(" http://static.amortal.top/"){{goodImgSrcDTOs[i].thumImgSrc}}' /></div>
            <div class="content"><p><a href="#">{{value.goodName}}</a></p><p>包装：{{value.packName}}&nbsp;&nbsp;数量：{{value.count}}</p></div>
            <div class="Operations">
                <p class="Price">￥{{value.goodPrice}}</p>
                <p><a href="javascript:void();" onclick="del({{value.id}},this)">删除</a></p>
            </div>
        </li>
        {{/each}}
    </script>
    @RenderSection("FooterScript", false)
    <script type="text/javascript">

        function del(cartRecordId, element) {
            $.ajax({
                url: "/Cart/Delete",
                data: { CartRecordId: cartRecordId },
                type: "post",
                dataType: "json",
                success: function (res) {
                    if (res.status == "ok") {
                        $(element).parent().parent().parent().remove();
                    } else if (res.status == "redirect") {
                        location.href = res.data;
                    } else if (res.status == "error") {
                        alert("删除失败："+res.errorMsg);
                        return false;
                    } else {
                        alert("请求错误" );
                    }
                }, error: function () {
                    alert("网络请求错误");
                }
            });
        }

        $(function () {
            $.ajax({
                url: "/Login/IsLogin",
                dataType: "json",
                type: "post",
                success: function (res) {
                    if (res.status == "yes") {
                        $('#isLogin').html(res.data).attr('href', 'javascript:void();');
                    } else {
                        $('#isLogin').html("[请登录]");
                    }
                }, error: function () {
                    alert("网络请求错误");
                }
            });

            $.ajax({
                url: "/Home/GetCartRecord",
                dataType: "json",
                type: "post",
                success: function (res) {
                    if (res.status == "ok") {
                        var html = template('test2', res.data);
                        if (html == "") {
                            return;
                        }
                        var cartRecords = res.data.cartRecordDTOs;
                        $('#shopping-amount').html(cartRecords.length);
                        $('#count').html(cartRecords.length);
                        var pirce = 0;
                        $('#goodTotalCount').html(cartRecords.length);
                        for (var i = 0; i < cartRecords.length; i++) {
                            pirce += (parseInt(cartRecords[i].goodPrice) * parseInt(cartRecords[i].count));
                        }
                        $('#zongjia').html(pirce);

                        $('#cart li').remove();
                        $('#cart').append(html);
                    } else {
                        $('#cart').append("<li>请先登入</li>");
                    }
                },
                error: function () {
                    layer.msg("网络错误");
                }
            });

            $('#exitLogin').click(function () {
                $.ajax({
                    url: "/Home/Exit",
                    dataType: "json",
                    type: "post",
                    success: function (res) {
                        if (res.status == "ok") {
                            location.reload();
                        } else if (res.status=="redirect") {
                            location.href = res.data;
                        } else {
                            layer.msg("退出失败："+res.errorMsg, { icon: 2, time: 1000 });
                        }
                    },
                    error: function () {
                        layer.msg("网络错误", { icon: 2, time: 1000 });
                    }
                })
            });
        });
    </script>
</body>
</html>
